<table>
	<tr>
		<td>
			<a class="button" href="<?php echo $this->baseUrl() ?>/cpmagazine/generatecsv">
				<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/gear_16.png);" class="inb">Eksportuj stany magazynowe</div>
			</a>
		</td>
	</tr>
</table>

<div class="bglist">
	<div class="bglistq">
		<form id="formrap" method="get">
			<table cellspacing="1" cellpadding="4" class="tlist">
				<tr>
					<th style="font-size:11px;">Producent</th>
					<th style="font-size:11px;">Kategoria</th>
					<th style="font-size:11px;">Podkategoria</th>
					<th style="font-size:11px;">Tag</th>
					<th style="font-size:11px;">Nazwa</th>
					<th style="font-size:11px;" colspan="2">Filtruj</th>
				</tr>
				<tr>
					<td><?php echo $this->formSelect( 'producent', $this->producent, null, $this->producent_list ) ?></td>
					<td><?php echo $this->formSelect( 'kategoria', $this->kategoria, null, $this->kat_list ) ?></td>
					<td><?php echo $this->formSelect( 'podkategoria', $this->podkategoria, null, $this->podkat_list ) ?></td> 
					<td><?php echo $this->formSelect( 'tag', $this->tag, null, $this->tag_list ) ?></td>
					<td><?php echo $this->formText( 'nazwa', $this->nazwa ); ?></td>
					<td>
						<a onclick="$('#formrap').submit()" class="button" href="javascript::void(null)">
							<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/save_16.png);" class="inb">OK</div>
						</a>
					</td>
					<td>
						<a class="button" href="<?php echo $this->baseUrl() ?>/cpmagazine">
							<div style="background:url(<?php echo $this->baseUrl() ?>/public/images/up_16.png);" class="inb">CLEAR</div>
						</a>
					</td>
			</table>
		</form>
	
		<table cellspacing="1" cellpadding="6" class="tlist">
			<?php 
			foreach( $this->list as $item ) { ?>
			<tr>
				<th colspan="2">Produkt</th>
				<th>Akcje</th>
			</tr>
			<tr>
				<td colspan="2"><?php echo $item['name_pl'] ?></td>
				<td>
					<a href="<?php echo $this->baseUrl() ?>/cpproducts/item2/id/<?php echo $item['p_id'] ?>/magazine/1" class="edit">Zarządzaj</a>
				</td>
			</tr>
			<tr>
				<th>Rozmiar</th>
				<th>Stan</th>
			</tr>
			<?php 
				foreach( $item->Dimension as $dem ) {
			?>
				<tr>
					<td><?php echo $dem['name'] ?></td>
					<td><?php echo $dem['stock'] ?></td>
				</tr>
			<?php 
				} 
			}
			?>
		</table>
	</div>
</div>
<?php  echo $this->render('global/pager.phtml'); ?>